From 51fec0a9c793e89f7b92030e9a0292519bf56fb9 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 15 Sep 2008 11:35:20 +0100 Subject: [PATCH] vtd: minor edge case memory leak Fixes an (unlikely) memory leak where mapped VT-d root entries are not unmapped on allocation failure code path. Signed-off-by: Ross Philipson --- xen/drivers/passthrough/vtd/iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 1a3757a2f4..c16d084776 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -152,6 +152,7 @@ static u64 bus_to_context_maddr(struct iommu *iommu, u8 bus) maddr = alloc_pgtable_maddr(); if ( maddr == 0 ) { + unmap_vtd_domain_page(root_entries); spin_unlock_irqrestore(&iommu->lock, flags); return 0; } -- 2.30.2